package org.shoukaiseki.supersaiyan.system.service.impl;

import java.util.List;
import org.shoukaiseki.supersaiyan.common.utils.DateUtils;
import org.shoukaiseki.supersaiyan.system.domain.qo.SysOrganizeQO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.shoukaiseki.supersaiyan.system.mapper.SysOrganizeMapper;
import org.shoukaiseki.supersaiyan.system.domain.SysOrganize;
import org.shoukaiseki.supersaiyan.system.service.ISysOrganizeService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 组织限制Service业务层处理
 *
 * @author shoukaiseki
 * @date 2022-10-17
 */
@Transactional
@Service
public class SysOrganizeServiceImpl implements ISysOrganizeService
{
    @Autowired
    private SysOrganizeMapper sysOrganizeMapper;

    /**
     * 查询组织限制
     *
     * @param orgId 组织限制主键
     * @return 组织限制
     */
    @Override
    public SysOrganize selectSysOrganizeByOrgId(Long orgId)
    {
        return sysOrganizeMapper.selectSysOrganizeByOrgId(orgId);
    }

    /**
     * 查询组织限制列表
     *
     * @param qo 组织限制
     * @return 组织限制
     */
    @Override
    public List<SysOrganize> selectSysOrganizeList(SysOrganizeQO qo)
    {
        return sysOrganizeMapper.selectSysOrganizeList(qo);
    }

    /**
     * 新增组织限制
     *
     * @param sysOrganize 组织限制
     * @return 结果
     */
    @Override
    public int insertSysOrganize(SysOrganize sysOrganize)
    {
        return sysOrganizeMapper.insertSysOrganize(sysOrganize);
    }

    /**
     * 修改组织限制
     *
     * @param sysOrganize 组织限制
     * @return 结果
     */
    @Override
    public int updateSysOrganize(SysOrganize sysOrganize)
    {
        sysOrganize.setUpdateTime(DateUtils.getNowDate());
        return sysOrganizeMapper.updateSysOrganize(sysOrganize);
    }

    /**
     * 批量删除组织限制
     *
     * @param orgIds 需要删除的组织限制主键
     * @return 结果
     */
    @Override
    public int deleteSysOrganizeByOrgIds(Long[] orgIds)
    {
        return sysOrganizeMapper.deleteSysOrganizeByOrgIds(orgIds);
    }

    /**
     * 删除组织限制信息
     *
     * @param orgId 组织限制主键
     * @return 结果
     */
    @Override
    public int deleteSysOrganizeByOrgId(Long orgId)
    {
        return sysOrganizeMapper.deleteSysOrganizeByOrgId(orgId);
    }
}
